#include "StdAfx.h"
#include "Sphere.h"

CSphere::CSphere(void)
{
}

CSphere::CSphere(CPoint3D pBegin, CPoint3D pEnd)
{
	m_Begin = pBegin;
	m_End = pEnd;
}

CSphere::~CSphere(void)
{
}

void CSphere::Draw()
{
	// if the object is selected, the drawing color is blue. Otherwise, it is black.
	if (selected == true)
	{
		glMaterialfv(GL_FRONT, GL_AMBIENT, blue);
	}
	else 
	{
		glMaterialfv(GL_FRONT, GL_AMBIENT, black);
	}

	glPushMatrix();
	glTranslatef((m_Begin.getX() + m_End.getX()) / 2 ,(m_Begin.getY() + m_End.getY()) / 2, (m_Begin.getZ() + m_End.getZ()) / 2);
	
	glRotatef(rotateX, 1.0, 0.0, 0.0);
	glRotatef(rotateY, 0.0, 1.0, 0.0);
	glRotatef(rotateZ, 0.0, 0.0, 1.0);

	glutSolidSphere(m_End.getX() - m_Begin.getX() , 50, 10);
	//glutWireCube(1);
	//glTranslatef(-(m_Begin.getX() + m_End.getX()) / 2 ,-(m_Begin.getY() + m_End.getY()) / 2, (m_Begin.getZ() + m_End.getZ()) / 2);
	glPopMatrix();
	//
	//glColor3f(1.0f, 1.0f, 1.0f);

	// Draw Body	
	//glTranslatef(0.5f ,-0.75f, 0.0f);
	//glutWireSphere(0.25f,20,20);


	// Draw Head
	
}
